package Com.Isman.Booking;

import Com.Isman.FinalVariable;
import android.content.Context;
import android.content.SharedPreferences;
import android.location.Location;
import android.os.Bundle;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;

public class PageMap extends MapActivity {
	
	public static final String PAGE_MAP = "Com.Isman.Booking.PageMap";
	
	public static final int PAGE_MAP_LIST = 1;
	public static final int PAGE_MAP_SINGLE = 2;
	
	public static final String PAGE_MAP_TYPE = "Com.Isman.Booking.PageMap.type";
	@SuppressWarnings("unused")
	private MapController mapControl;
	
	private MapView mapView;
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.pagemap);
		
		mapView = (MapView)findViewById(R.id.myMap);
		
        mapControl = mapView.getController();
        mapView.setTraffic(true);
        mapView.setBuiltInZoomControls(true);
        

        findLocation();
	}

	private void findLocation(){
        Location myLocation = new Location("MyLocation");
        
		SharedPreferences setting = getSharedPreferences(FinalVariable.APP_PREFERENCES, Context.MODE_PRIVATE);
		myLocation.setLatitude(setting.getFloat(FinalVariable.APP_LOCATION_LATITUBE, 0.0f));
		myLocation.setLongitude(setting.getFloat(FinalVariable.APP_LOCATION_LONGITUBE, 0.0f));
		
//        List<Overlay> mapOverlays = mapView.getOverlays();
//        Drawable drawable = this.getResources().getDrawable(R.drawable.icon);
//        HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable,this);
//        GeoPoint point = new GeoPoint(30443769,-91158458);
//        OverlayItem overlayitem = new OverlayItem(point, "Laissez les bon temps rouler!", "I'm in Louisiana!");
//
//        GeoPoint point2 = new GeoPoint(17385812,78480667);
//        OverlayItem overlayitem2 = new OverlayItem(point2, "Namashkaar!", "I'm in Hyderabad, India!");
//
//        itemizedoverlay.addOverlay(overlayitem);
//        itemizedoverlay.addOverlay(overlayitem2);
//
//        //mapOverlays.add(itemizedoverlay);
	}
	
	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}
	
}
